package com.dantwining.jade.oo;

import jade.core.AID;
import jade.oo.core.behaviours.MessageReceiver;
import jade.oo.core.behaviours.Outbox;

public class TimeResponderAction implements MessageReceiver<String> {

	private final Outbox outbox;

	public TimeResponderAction(Outbox outbox) {
		this.outbox = outbox;
	}

	@Override
	public void receive(String message, AID sender) {
		long currentTime = System.currentTimeMillis();
		outbox.send(currentTime, sender);
	}
}
